home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / SwingApplet.java < prev    next >
Text File  |  1998-09-28  |  1KB  |  35 lines

  1. /*
  2.     A GUI version of the SwingApplet sample from Sun. 
  3.     - A very simple example of a JApplet.
  4. */
  5.  
  6. import com.sun.java.swing.*;
  7. import java.awt.*;
  8.  
  9. public class SwingApplet extends JApplet
  10. {
  11.     public void init()
  12.     {
  13.         // This line prevents the "Swing: checked access to system event queue" message seen in some browsers.
  14.         getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
  15.         
  16.         // This code is automatically generated by Visual Cafe when you add
  17.         // components to the visual environment. It instantiates and initializes
  18.         // the components. To modify the code, only use code syntax that matches
  19.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  20.         // parse your Java file into its visual environment.
  21.         //{{INIT_CONTROLS
  22.         getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER,5,5));
  23.         setSize(240,74);
  24.         JButton1.setText("Hello, I'm a Swing Button!");
  25.         JButton1.setActionCommand("Hello, I'm a Swing Button!");
  26.         getContentPane().add(JButton1);
  27.         JButton1.setBounds(31,5,177,25);
  28.         //}}
  29.     }
  30.  
  31.     //{{DECLARE_CONTROLS
  32.     com.sun.java.swing.JButton JButton1 = new com.sun.java.swing.JButton();
  33.     //}}
  34. }
  35.